/*
 * Background Flickr: Copyright (C) 2009  Craig McNicholas
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.ddw.app.bflickr.flickr.api.response;

import com.ddw.app.bflickr.flickr.api.FlickrAccount;
import com.ddw.app.bflickr.logging.Log;
import com.ddw.app.bflickr.logging.LogFactory;

/**
 * Class to hold a flickr find responses data including the user account 
 * that has been found if any.
 * @author craig
 *
 */
public class FlickrFindResponse extends FlickrApiResponse {

	private Log log = LogFactory.createInstance(this.getClass());
	private FlickrAccount user = null;
	
	/**
	 * Getter of the found user account. <b>This object is <u>null</u> by default</b>
	 * @return the flickr account that was found by a find request
	 */
	public FlickrAccount getUser() {
		return this.user;
	}
	
	/**
	 * Setter for the flickr account found from this request. 
	 * @param user the flickr account to set
	 */
	public void setUser(FlickrAccount user) {
		if(user == null) { 
			log.error("The user account cannot be null");
			throw new IllegalArgumentException("The user account cannot be null");
		}
		this.user = user;
	}
	
}
